﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BLL.Formation;
using BLL.Formateur;
using System.Diagnostics;
using DAL.EntityDataModel;

namespace BLL.SessionFormation
{
    public class SessionFormationBO
    {
        public int Identifiant { get; set; }
        public FormationBO Formation { get; set; }
        public DateTime DateDebut { get; set; }
        public DateTime DateFin { get; set; }
        public bool Inter { get; set; }
        public int? IdCommercial { get; set; }
        public FormateurBO Formateur { get; set; }

        private string _DateDebutDisplay;
        public string DateDebutDisplay
        { 
            get
            {
                if (DateDebut != null)    
                    _DateDebutDisplay = DateDebut.ToShortDateString();
                return _DateDebutDisplay;
            }
            set
            {
                _DateDebutDisplay = value;
            }
        }

        private string _DateFinDisplay;
        public string DateFinDisplay
        {
            get
            {
                if (DateFin != null)
                    _DateFinDisplay = DateFin.ToShortDateString();
                return _DateFinDisplay;
            }
            set
            {
                _DateFinDisplay = value;
            }
        }

        private string _FormationName;
        public string FormationName
        {
            get
            {
                if (Formation != null)
                    _FormationName = Formation.Libelle;
                
                return _FormationName;
            }
            set
            {
                _FormationName = value;
            }
        }

        private string _FormateurName;
        public string FormateurName
        {
            get
            {
                if (Formateur != null)
                    _FormateurName = Formateur.Nom + " " + Formateur.Prenom;
                    
                return _FormateurName;
            }
            set
            {
                _FormateurName = value;
            }
        }        
    }
}
